package com.itheima.thread05;

import com.itheima.thread04.Desk;

import java.util.concurrent.ArrayBlockingQueue;

//消费者
public class Foodie implements Runnable {
    private ArrayBlockingQueue<String> list;
    public Foodie(ArrayBlockingQueue<String> list) {
        this.list = list;
    }
    @Override
    public void run() {
        while (true){
            try {
                String take = list.take();
                System.out.println("吃货拿了一个"+take);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
